{# A backend pattern: its shape as a strip of steps (how many of the instances a step applies to follow it; a step that is only counted, like Current user, shows how many it applies to), its rules and how well they hold, one clean instance's source, and every instance found in the app. #} {% from "components/macros/layout.html" import badge, card, code_block, progress %}
{{ pattern.summary }}
{{ step.label }}
{{ step.detail }}
{% if step.followed is not none %}{{ step.followed }} of {{ step.applicable }}
{{ progress(step.followed / step.applicable if step.applicable else 1, "ok" if step.followed == step.applicable else "warn", label=step.label ~ " conformance") }} {% elif step.applicable != total %}{{ step.applicable }} routes
{% endif %}{{ rule.why }}
{{ progress(rule.followed / rule.applicable if rule.applicable else 1, "ok" if not rule.violations else "warn", label=rule.title) }} {% if rule.violations %}{{ instance.label }}{{ canonical.path }}
{{ code_block(canonical.code, lang="python") }} {% endcall %} {% endif %}